<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    function outer() {
        let a = 100;
        function fun() {
            console.log(a);
        }
        return fun; // 返回值fun
    }
    //闭包 封闭数据，外部函数可以访问内部变量
    const fu = outer();// fu() === outer() == fun = funtion(){}
    fu();
</script>

</html>